﻿using System.ComponentModel.DataAnnotations;
using YFurion.Application;

namespace UpperComputer.Application
{
    public class LoginDto : LoginBaseDto
    {
        [Required(ErrorMessage = "密码不能为空"), RegularExpression(@"^[a-zA-Z0-9]{32}$", ErrorMessage = "密码必须由32个字母或数字组成")]
        public override string Password { get; set; }

        [Required(ErrorMessage = "验证码不能为空"), RegularExpression(@"^[a-zA-Z0-9]{4}$", ErrorMessage = "验证码必须由4个字母或数字组成")]
        public string VerificationCode { get; set; }

        [Required(ErrorMessage = "验证标识不能为空"), RegularExpression(@"^[0-9]{15}$", ErrorMessage = "验证标识必须由15个数字组成")]
        public string VerificationIdentifier { get; set; }
    }

    public class LoginBaseDto : BaseDto
    {
        [Required(ErrorMessage = "用户名不能为空")]
        public string Username { get; set; }

        [Required(ErrorMessage = "密码不能为空")]
        public virtual string Password { get; set; }
    }
}
